-- GENERATED SPELL FOR [Earthen Templar] --


function spell0_15307(pUnit, Event) --@Elemental Spawn-in,Self--
pUnit:FullCastSpellOnTarget(25035,pUnit)
pUnit:RegisterEvent('Sorts_15307', 548, 1)
end

function spell1_15307(pUnit, Event) --@Entangling Roots,n/a--
pUnit:FullCastSpellOnTarget(22127,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15307', 11500, 1)
end

function spell2_15307(pUnit, Event) --@Knock Away,n/a--
pUnit:FullCastSpellOnTarget(18813,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15307', 579, 1)
end

function Sorts_15307(pUnit, Event)
local choix_sorts_15307 = math.random(0, 2)
if choix_sorts_15307 == 0 then
pUnit:RegisterEvent('spell0_15307', 1, 1)
end
if choix_sorts_15307 == 1 then
pUnit:RegisterEvent('spell1_15307', 1, 1)
end
if choix_sorts_15307 == 2 then
pUnit:RegisterEvent('spell2_15307', 1, 1)
end
end

function mob15307_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15307', math.random(1500, 3000), 1)
end

function mob15307_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15307_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15307_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15307, 1, 'mob15307_Action')
RegisterUnitEvent(15307, 2, 'mob15307_Leave')
RegisterUnitEvent(15307, 3, 'mob15307_Kill')
RegisterUnitEvent(15307, 4, 'mob15307_Die')
